//
//  KVThreadPoolUtils.m
//  KevinTool
//
//  Created by kevin on 2018/5/31.
//

#import "KVThreadPoolUtils.h"

@implementation KVThreadPoolUtils

/// 执行多线程操作
+ (void)executeToMultiThreadPool:(dispatch_block_t)block {
    if( block == NULL ){
        return;
    }
    
    // 启动线程
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
}

/// 执行主线程操作
+ (void)executeToMainThreadPool:(dispatch_block_t)block {
    if( block == NULL ){
        return;
    }
    
    // 启动主线程
    dispatch_async(dispatch_get_main_queue(), block);
}

/// 添加到主线程操作
+ (void)addToMainThreadPool:(dispatch_block_t)block {
    [[NSOperationQueue mainQueue] addOperationWithBlock:block];
}

@end
